package MyLinkedList;

import java.util.Iterator;

public interface List<E> extends Iterable<E> {
	
	/**
	 * inserts the specified element at the specified position in this list
	 * @param index
	 * @param element
	 */
	void add(int index, E element);
	
	/***
	 * returns the element at the specified position in this list
	 * @param index
	 * @return
	 */
	E get(int index);
	
	/***
	 * method inherited from Iterable<E>
	 * returns an iterator over the elements in this list in proper sequence
	 * method remove is supported
	 */
	Iterator<E> iterator();
	
	/***
	 * removes the element at the specified position in this list
	 * returns the element previously at the specified position
	 * @param index
	 * @return
	 */
	E remove(int index);
	
	/***
	 * replaces the element at the specified position in this list with the specified element
	 * returns the element previously at the specified position
	 * @param index
	 * @param element
	 * @return
	 */
	E set(int index, E element);
	
	/***
	 * returns the number of elements in this list
	 * @return
	 */
	int size();
	
	boolean isEmpty();

}
